package com.bdqn.hospital.mapper;

import com.bdqn.hospital.pojo.Registry;
import org.apache.ibatis.annotations.Insert;
import com.bdqn.hospital.pojo.Registry;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @version : 1.0
 * @Author :guogd
 * @createTime: 2023/03/01 14:29
 * @Description: com.bdqn.hospital.mapper
 */
@Mapper
public interface RegistryMapper {
    /**
     * 新增挂号单信息
     * @param registry
     * @return
     */
    @Insert("insert into registry values(null,#{patientId},#{userId},#{scheduleId},#{departmentId},#{roomId},1,#{fee},#{payFee},#{medicareFee},#{isMedicare},now(),null,now(),null)")
    Integer addRegistry(Registry registry);
    /**
     * 获取实际挂号费
     * @param registryId
     * @return
     */
    Registry getPayById(Integer registryId);
    /**
     * 查询挂号信息
     * @return
     */
    List<Registry> getAll(@Param("idCard") String idCard,
                          @Param("userName")Integer userName
            ,@Param("status")Integer status
            ,@Param("userId")Integer userId);
    List<Registry> getAll2(@Param("idCard") String idCard,
                          @Param("userName")Integer userName
            ,@Param("status")Integer status
            ,@Param("roomId")Integer roomId
            ,@Param("userId")Integer userId);


    /**
     * 修改挂号状态
     * @param id
     * @return
     */

    Integer updStatus(@Param("id")Integer id,@Param("status") Integer status ,@Param("type") Integer type);
}
